#pragma once
#include <memory>
#include <map>
#include <string>

#include "boost/asio.hpp"




class Session;
using boost::asio::ip::tcp;


class Server
{
public:
    Server(boost::asio::io_context& io_context, short port);
    void StartAccept();
    ~Server();
    void ClearSession(std::string uuid);

private:
    void handleAccept(const boost::system::error_code& ec,std::shared_ptr<Session> session);

private:
    boost::asio::io_context& io_context_;
    tcp::acceptor acceptor_;

    short port_;
    std::map<std::string,std::shared_ptr<Session>> sessions_;
};
